1. Field of the Invention
The present invention relates to techniques for detecting incorrect responses to network queries. More specifically, the present invention relates to a method and apparatus for using a test query to detect whether an Internet gateway device's configured domain-name system (DNS) server incorrectly responds to network queries.
2. Related Art
Internet Service Providers (ISPs) typically provide a single Internet Protocol (IP) address per Internet connection account, which would conventionally imply that only one Internet-enabled device per account can be coupled to the ISP's network at any given time. This is unfortunate, given that today many households have multiple computers and other Internet-enabled devices that the customer may desire to have connected to the ISP's network concurrently.
A common solution to this Internet connection-sharing problem is to use a Network Address Translation (NAT) device (commonly called an “Internet gateway”) to share a single IP address with multiple Internet-enabled devices, which are coupled to the Internet gateway through a local area network (LAN). Note that an Internet gateway can include wired Internet gateways and wireless Internet gateways. Furthermore, note that the Internet gateway can be implemented in a number of ways, including but not limited to: (1) a desktop or a laptop computer system coupled to the Internet, which is configured to share the Internet connection with devices on the LAN; or (2) a standalone device coupled to the Internet, which is configured to share the Internet connection with devices on the LAN. The Internet gateway device typically has at least two physical interfaces and two Internet addresses: a public one that is used to communicate with the ISP's network, and a private internal one that is used to communicate with devices on the LAN. From the point of view of an outside observer, all the customer's local computers and other Internet-enabled devices are made to appear as a single device with a single public IP address.
If the Internet gateway is configured to offer Dynamic Host Configuration Protocol (DHCP) service to the customer's devices, the Internet gateway usually assigns a private IP address to each Internet-enabled device coupled to the Internet gateway. The Internet gateway also provides its own LAN IP address to these Internet-enabled devices as both the default gateway to which they should send outbound IP packets, and the default DNS server to which they should send DNS queries. Since usually the Internet gateway is not, itself, authoritative for any DNS domains, all it does with received DNS queries is forward them on to a more knowledgeable DNS server elsewhere, typically one operated by the customer's ISP.
When communicating with services on the Internet, a client device sends IP packets via the Internet gateway. The Internet gateway rewrites the source IP address in each packet to be the common shared public IP address, and then forwards it through the ISP's network to the Internet. During this process, the Internet gateway typically keeps track of which packet was sent by which local Internet-enabled device, so that when response packet(s) return from the Internet via the ISP's network to the Internet gateway, the Internet gateway is able to route those response packets to the appropriate Internet-enabled device that originated the corresponding outgoing request packet.
For example, FIG. 1 illustrates an Internet gateway 104, which is coupled both to network 102 and local network 106. Local network 106 couples Internet gateway 104 with computers 108, 110, and 112, and Ethernet device 114. Network 102 can generally include any type of wired or wireless communication channel capable of coupling together computing nodes. This includes, but is not limited to, a local area network, a wide area network, or a combination of networks, such as the Internet.
An Internet gateway (or any other Internet sharing device) such as Internet gateway 104, typically includes a mechanism for forwarding DNS queries to DNS servers which can provide answers to the DNS queries. This mechanism allows Internet gateway 104 to function as the default “configured DNS server” for all devices on local network 106.
Note that a “configured DNS server” can include any DNS-enabled device which can return a response to a DNS query, such as (1) an authoritative DNS server, (2) a recursive DNS server, and (3) a forwarding DNS server. An authoritative DNS server answers DNS queries directed to a domain or a set of domains that have been delegated to the authoritative DNS server. In doing so, the authoritative DNS server maintains DNS records for the delegated domain or set of domains, and is the only type of DNS server that can answer authoritatively for the delegated domain or set of domains.
A recursive DNS server (a DNS cache) receives DNS queries, and performs queries to lookup the requested domain. When an answer is received from an authoritative DNS server or from another recursive DNS server, the recursive DNS server caches the answer in its local DNS cache. If a query is made for a DNS record which was previously-cached in the local DNS cache, the recursive DNS server uses the cached information to answer the DNS query instead of performing another DNS query.
A forwarding DNS server (a DNS relay) forwards DNS queries to either a recursive DNS server or to an authoritative DNS server. As mentioned above, Internet gateways typically contain simple DNS relays, which function as the “configured DNS server” for local devices that communicate through the Internet gateway.
Although Internet gateways are typically able to enable multiple Internet-enabled devices to share a single Internet connection successfully, some of these Internet gateways have functional limitations. One such functional limitation causes the Internet gateway to incorrectly handle the forwarding of valid DNS queries to DNS servers. Furthermore, such functionally-limited Internet gateways can crash and completely cease functioning when processing certain valid DNS queries, thereby disrupting their ability to perform their intended function, namely providing Internet access to local computers and similar Internet-enabled devices.
Hence, what is needed is a method and an apparatus to determine if a configured DNS server suffers from this particular known functional limitation so that the client can determine when it should avoid performing those certain valid DNS queries that are known to have a high likelihood of crashing that particular device.